<route lang="json5">
{
  style: {
    navigationBarTitleText: '个人中心',
  },
}
</route>

<template>
  <view
    class="bg-white overflow-hidden pt-2 px-4"
    :style="{ marginTop: safeAreaInsets?.top + 'px' }"
  >
    <view>
      <text class="text-center">当前用户: {{ userName }}</text>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { useUserStore } from '@/store/user'

const userStore = useUserStore()

// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()

const userName = computed(() => {
  return userStore.userInfo.nickname
})

onShow(() => {})

onMounted(() => {})
</script>

<style lang="scss" scoped>
.test-css {
  margin-top: 16px;
}
</style>
